home *** CD-ROM | disk | FTP | other *** search
- Path: atglab.bls.com!Alun.Champion
- From: Alun.Champion@bridge.bst.bls.com (Alun Champion)
- Newsgroups: comp.lang.c
- Subject: Re: Accessing UNIX environment variables with C
- Date: 26 Jan 1996 19:50:21 GMT
- Organization: Computer People Inc.
- Message-ID: <ALUN.CHAMPION.96Jan26145021@g7240065.bridge.bst.bls.com>
- References: <4eaqt5$f23@zippy.cais.net> <3108f268.14258749@news.demon.co.uk>
- NNTP-Posting-Host: bstfirewall.bst.bls.com
- In-reply-to: dave@stsdaveb.demon.co.uk's message of Fri, 26 Jan 1996 15:28:08
- GMT
-
- In article <3108f268.14258749@news.demon.co.uk> dave@stsdaveb.demon.co.uk (Dave Thornton) writes:
-
- : On 26 Jan 1996 15:10:29 GMT, usaid@cais.cais.com (USAID) wrote:
-
- :> Can someone tell me how to use a UNIX environment variable in C? The
- :> equivalent statement in Perl is the %ENV{VARNAME} statement, where
- :> VARNAME is the environment variable.
-
- : I think its the standard ANSI C function getenv();
-
- : /* Example for getenv */
- [snip]
- : void main ()
- [snip]
-
- Yes, getenv is an ANSI C function but void main() is not an ANSI C program.
- main() must be declared
- int main(void)
- or
- int main(int argc, char* argv[])
-
- Regards
-
- -A.
- --
- | A.Champion |
-